//
//  GrantReviewConTableViewCell.m
//  DistributorAB
//
//  Created by 主事丫环 on 2019/9/26.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "GrantReviewConTableViewCell.h"

@implementation GrantReviewConTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setFrame:(CGRect)frame{
    //frame.origin.x += 10;
    //frame.origin.y += 10;
    frame.size.height -= 10;
    //frame.size.width -= 20;
    [super setFrame:frame];
}

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        UIView *bottomV = [[UIView alloc] init];
        bottomV.frame = CGRectMake(0, 0, KWIDTH, 180);
        bottomV.layer.cornerRadius = 10;
        bottomV.layer.masksToBounds = YES;
        [self.contentView addSubview:bottomV];
        
        UILabel *dateTitLab = [[UILabel alloc] init];
        //dateTitLab.backgroundColor = [UIColor redColor];
        dateTitLab.frame = CGRectMake(24, 15, KWIDTH-24*2 -70, 20);
        dateTitLab.text = @"2019-09-10 21:55";
        dateTitLab.font = FontSize(14);
        dateTitLab.textColor = [UIColor colorWithHexString:@"#666666"];
        [bottomV addSubview:dateTitLab];
        self.dateTitLab = dateTitLab;
        
        UIButton *rightBtn = [[UIButton alloc] init];
        //rightBtn.backgroundColor = [UIColor cyanColor];
        rightBtn.frame = CGRectMake(dateTitLab.right +10, 15, 60, 20);
        [rightBtn setTitle:@"未审核" forState:UIControlStateNormal];
        [rightBtn setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
        rightBtn.titleLabel.font = FontSize(14);
        [rightBtn addTarget:self action:@selector(rightBtnAction:) forControlEvents:UIControlEventTouchUpInside];
        [bottomV addSubview:rightBtn];
        self.rightBtn = rightBtn;
        
        UILabel *fwlxTitLab = [[UILabel alloc] init];
        //fwlxTitLab.backgroundColor = [UIColor redColor];
        fwlxTitLab.frame = CGRectMake(24, dateTitLab.bottom +8, 70, 20);
        fwlxTitLab.text = @"所在地区:";
        fwlxTitLab.font = FontSize(14);
        fwlxTitLab.textColor = [UIColor colorWithHexString:@"#272727"];
        [bottomV addSubview:fwlxTitLab];
        
        UILabel *countLab = [[UILabel alloc] init];
        //countLab.backgroundColor = [UIColor redColor];
        countLab.frame = CGRectMake(fwlxTitLab.right +20, dateTitLab.bottom +8, KWIDTH/2, 20);
        countLab.text = @"河南省郑州市管城回族区";
        countLab.font = FontSize(14);
        countLab.textColor = [UIColor colorWithHexString:@"#272727"];
        [bottomV addSubview:countLab];
        self.countLab = countLab;
        
        UILabel *yxqTitLab = [[UILabel alloc] init];
        //yxqTitLab.backgroundColor = [UIColor redColor];
        yxqTitLab.frame = CGRectMake(24, fwlxTitLab.bottom +10, 70, 20);
        yxqTitLab.text = @"配件名称:";
        yxqTitLab.font = FontSize(14);
        yxqTitLab.textColor = [UIColor colorWithHexString:@"#272727"];
        [bottomV addSubview:yxqTitLab];
        
        UILabel *yxqLab = [[UILabel alloc] init];
        //yxqLab.backgroundColor = [UIColor redColor];
        yxqLab.frame = CGRectMake(yxqTitLab.right +20, fwlxTitLab.bottom +10, KWIDTH/2, 20);
        yxqLab.text = @"A5型";
        yxqLab.font = FontSize(14);
        yxqLab.textColor = [UIColor colorWithHexString:@"#272727"];
        [bottomV addSubview:yxqLab];
        self.yxqLab = yxqLab;
        
        UILabel *szdqTitLab = [[UILabel alloc] init];
        //szdqTitLab.backgroundColor = [UIColor redColor];
        szdqTitLab.frame = CGRectMake(24, yxqTitLab.bottom +10, 80, 20);
        szdqTitLab.text = @"补贴工时费";
        szdqTitLab.font = FontSize(14);
        szdqTitLab.textColor = [UIColor colorWithHexString:@"#272727"];
        [bottomV addSubview:szdqTitLab];
        
        UILabel *szdqConLab = [[UILabel alloc] init];
        //szdqConLab.backgroundColor = [UIColor redColor];
        szdqConLab.frame = CGRectMake(szdqTitLab.right, yxqTitLab.bottom +10, KWIDTH/2, 20);
        szdqConLab.text = @"$30";
        szdqConLab.font = FontSize(14);
        szdqConLab.textColor = [UIColor colorWithHexString:@"#272727"];
        [bottomV addSubview:szdqConLab];
        self.szdqConLab = szdqConLab;
        
        UILabel *line2 = [[UILabel alloc] init];
        line2.backgroundColor = [UIColor colorWithHexString:@"#F2F2F2"];
        line2.frame = CGRectMake(10, szdqTitLab.bottom +8, KWIDTH -20, 1);
        [bottomV addSubview:line2];
        
        UILabel *ckxqTitLab = [[UILabel alloc] init];
        //ckxqTitLab.backgroundColor = [UIColor redColor];
        ckxqTitLab.frame = CGRectMake(24, line2.bottom +10, 70, 20);
        ckxqTitLab.text = @"查看详情";
        ckxqTitLab.font = FontSize(14);
        ckxqTitLab.textColor = [UIColor colorWithHexString:@"#272727"];
        [bottomV addSubview:ckxqTitLab];
        
        UIImageView *rightBgImg = [[UIImageView alloc] init];
        rightBgImg.backgroundColor = [UIColor orangeColor];
        rightBgImg.frame = CGRectMake(bottomV.right-30, line2.bottom +5, 20, 30);
        [rightBgImg setImage:imgname(@"jinruimage")];
        [bottomV addSubview:rightBgImg];
        
    }
    return self;
}

//右侧 按钮 点击事件处理(未处理 处理中 已处理)
- (void)rightBtnAction:(UIButton *)button {
    if (self.myblock) {
        self.myblock(0,@"");
    }
    NSLog(@"您点击了 cell右上角的 按钮");
}


@end
